from rest_framework import serializers

from finance.models import FinanceOfStore
from orders.models import Orders, OrderItem


class StoreFinanceViewSerializer(serializers.ModelSerializer):

    class Meta:
        model = FinanceOfStore
        fields = '__all__'


class OrderItemSerializer(serializers.ModelSerializer):
    class Meta:
        model = OrderItem
        fields = "__all__"
        depth = 1


class OrderForFinanceSerializer(serializers.ModelSerializer):
    orderitem_set = OrderItemSerializer(many=True)
    class Meta:
        model = Orders
        fields = "__all__"
        depth = 1

